/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.generator.command;

import ru.jSkyRoom.generator.command.rule.Rule;
import java.util.Collection;
import ru.jSkyRoom.interfaces.major.Major;

/**
 *
 * @author Rakev
 */
public class CompositeCommand<T> implements Command<T> {

    private Collection<Rule<T>> rules;

    public CompositeCommand(Collection<Rule<T>> rules) {
        this.rules = rules;
    }

    @Override
    public T apply(T item) {
        for (Rule rule : rules) {
            rule.apply(item);
        }
        return item;
    }
}
